ision_id ) { $latest = wp_get_post_revisions( $post_id, [ 'posts_per_page' => 1, 'orderby' => 'ID', 'order' => 'DESC', ] ); $revision_id = $latest ? (int) array_key_first( $latest ) : 0; } if ( ! $revision_id ) { return new \WP_Error( 'revision_failed', __( 'Could not create a revision snapshot for this post.', 'elementor' ), [ 'status' => \WP_Http::INTERNAL_SERVER_ERROR ] ); } return (int) $revision_id; } }